package com.gp.exploredao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

public class exploreInformation {
    public List<String> getExolore(String info) {
        Connection connect = Dbutils.Connect();
        String sql = "select * from explore where exploretext like'" + info + "%'";
        PreparedStatement pstmt = Dbutils.getPrepareStatement(connect, sql);
        ResultSet rs = null;
        List<String> list = new ArrayList<>();
        try {
            rs = pstmt.executeQuery();
            int i = 0;
            if (rs != null) {
                while (rs.next()) {
                    String s = rs.getString(2);
                    list.add(s);
                }
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        Dbutils.closePreparestatement(pstmt);
        Dbutils.closeConnection(connect);
        return list;
    }
}
